import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
//引入wangEditor
import wangEditor from "wangeditor";
//给Vue添加一个全局属性, 之后可以通过this.$wangEditor访问到此属性
Vue.prototype.wangEditor = wangEditor;

//引入ElementUI
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
Vue.config.productionTip = false

//重写方法解决跳转到同一路由报错问题
const myReplace = router.replace;
router.replace = function replace(location) {
  return myReplace.call(this,location).catch(err=>err);
};
const myPush = router.push;
router.push = function push(location) {
  return myPush.call(this,location).catch(err=>err);
};


//引入Axios
import axios from 'axios'
Vue.prototype.axios=axios
//导入qs框架
import qs from 'qs'
Vue.prototype.qs=qs;
//导入baseUrl  @代表src路径
import BaseUrl from "@/http/baseUrl";
Vue.prototype.BASE_URL = BaseUrl;


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
